package com.example.demo.service.impl;

//import com.example.demo.entity.User;
import com.example.demo.mapper.GoodsMapper;
import com.example.demo.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.demo.entity.Goods;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public void insertGoods(Goods goods) throws Exception {
        goodsMapper.insertGoods(goods);
    }

    @Override
    public void deleteGoods(String GNo) throws Exception {
        goodsMapper.deleteGoods(GNo);
    }

    @Override
    public void updateGood(Goods goods) throws Exception {
        goodsMapper.updateGoods(goods);
    }

    @Override
    public Goods findByGNo(String GNo) throws Exception {
        System.out.println("GoodsServiceImpl findByGNo GNo)="+GNo);
        return goodsMapper.findByGNo(GNo);
    }

    @Override
    public List<Goods> selectAll() throws Exception{
        System.out.println("GoodsServiceImpl selectAll");
        return goodsMapper.selectAll();
    }
}
